'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.Code = {
    type: String,
    Name: '编码',
    IsUnique: true,
    IsEmpty: false,
    trim: true
};
modelField.Name = {
    type: String,
    Name: '名称',
    IsEmpty: false,
    trim: true
};
modelField.Department = {
    type: Schema.ObjectId,
    ref: 'Department',
    Name: '部门',
    IsEmpty: false
};
modelField.IsShared = {
    type: Boolean
};
modelField.Remark = {
    type: String
};
modelField.IsEffective = {
    type: Boolean
};

var newModel = new Model(modelField);
newModel.addIndex({Code: 1});
newModel.addIndex({IsEffective: 1});
newModel.create('WorkLocation', '工位');
